<template>
	<view class="">
		<view class="" style="margin: 30rpx;color: #9c9c9c;display: flex; align-items: center;justify-content: space-around;">
			<text>患者姓名：{{title.xm}}</text> 
			<text>性别：{{title.xb}}</text>
			<text>年龄：{{title.nl}} 岁</text>
		</view>
		<uni-steps v-if="list2.length" :options="list2" :active="active" direction="column" />
		<view class="no-data" v-else style="text-align: center;">
			<image src="../../static/icons/nodata.png" style="width: 150rpx;" mode="widthFix"></image>
			<text>暂无诊断记录</text>
		</view>
	</view>
</template>

<script>
	import { illnessById } from '../../api/huanzhe.js'
	export default {
		data() {
			return {
				active: -1,
				list2: [],
				title:{
					xm:null,
					xb:null,
					nl:null
				}
			};
		},
		onLoad(option){
			var query=JSON.parse(option.data)
			this.title.xm=query.xm
			this.title.xb=query.xb
			this.title.nl=query.nl
			this.illnessByIds(query.id)
		},
		methods:{
			// 根据患者id查询
			illnessByIds(hzId){
				illnessById(hzId).then(res=>{
					res.rows.forEach((item,index)=>{
						var list={
							title:'处置医生:'+item.ysname,
							desc: '记录时间：'+item.sj+
							'\n诊断：'+item.zd+
							'\n备注：'+item.bz
						}
						this.list2.push(list)
					})
				})
			}
		}
	}
</script>

<style lang="scss">
.no-data {
	position: absolute;
	top: 0rpx;
	left: 0;
	right: 0;
	bottom: 0;
	color: #333333;
	width: 100%;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
}
</style>